package com.guodi.map.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guodi.map.entity.MapParam;
import com.guodi.map.mapper.MapParamMapper;
import com.guodi.map.service.IMapParamService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @描述：地图参数列表 服务类
 * @作者: 代鹏刚
 * @日期: 2019-12-12
 */
@Service
public class MapParamServiceImpl extends ServiceImpl<MapParamMapper, MapParam> implements IMapParamService {
    @Resource
    private MapParamMapper mapParamMapper;

    @Override
    public List<MapParam> listBySchemeAndOrg(String schemeId, String divisionCode) {
        return mapParamMapper.listBySchemeAndOrg(schemeId, divisionCode);
    }

    @Override
    public MapParam findByProjectCode(String projectCode, String divisionCode) {
        List<MapParam> byProjectCode = mapParamMapper.findByProjectCode(projectCode, divisionCode);
        return byProjectCode.isEmpty()? null: byProjectCode.get(0);
    }
}